import React, { Component } from 'react';
import businessMessage from './BusinessMessage.module.css';
import { Row, Col,Pagination } from 'antd';
export default class BusinessMessage extends Component {
    constructor(props){
        super(props)
        this.state = {
        }
    }
    handlePageChange = (page, pageSize)=>{
        console.log(page, pageSize,666)
        // 向服务器 请求该页数据
    }
    render() {
        return (
            <div className = {businessMessage.content}>
               {this.state.message.map(item => <Row key = {item.time} className = {businessMessage.message}>
                    <Col span={12} className = {businessMessage.leftContent}>
                        {(item.isRead === 0 ? false:true)?<span className = {businessMessage.redCircle}></span>:null} 
                        {item.content}
                    </Col>
                    <Col span={12} className = {businessMessage.rightTime}>
                        {item.time}
                    </Col>
                </Row> )}
                <Pagination
                total={this.state.message.length}
                pageSize = {5}
                hideOnSinglePage = {true}
                showQuickJumper
                showTotal={total => `总共 ${total} 页`}
                onChange = {this.handlePageChange}
                />
            </div>
        )
    }
}
